<!--
  ~ MIT License
  ~
  ~ Copyright (c) 2021-2022 yangrunkang
  ~
  ~ Author: yangrunkang
  ~ Email: yangrunkang53@gmail.com
  ~
  ~ Permission is hereby granted, free of charge, to any person obtaining a copy
  ~ of this software and associated documentation files (the "Software"), to deal
  ~ in the Software without restriction, including without limitation the rights
  ~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  ~ copies of the Software, and to permit persons to whom the Software is
  ~ furnished to do so, subject to the following conditions:
  ~
  ~ The above copyright notice and this permission notice shall be included in all
  ~ copies or substantial portions of the Software.
  ~
  ~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  ~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  ~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  ~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  ~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  ~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  ~ SOFTWARE.
  -->

<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      th:replace="index">
<!--css-->
<link th:fragment="css" type="text/css" rel="stylesheet" th:href="${ossStatic} + @{/css/radio-station/record.css}"/>
<!--脚本-->
<script async="async" th:fragment="js" type="text/javascript" th:src="${ossStatic} + @{/js/radio-station/common.js}"></script>
<script async="async" th:fragment="js" type="text/javascript" th:src="${ossStatic} + @{/js/radio-station/record.js}"></script>
<script th:fragment="js" type="text/javascript" th:src="${ossStatic} + @{/plugins/record/recorder.mp3.min.js}"></script>
<script th:fragment="js" type="text/javascript" th:src="${ossStatic} + @{/plugins/record/extensions/frequency.histogram.view.js}"></script>
<script th:fragment="js" type="text/javascript" th:src="${ossStatic} + @{/plugins/record/extensions/lib.fft.js}"></script>
<div th:fragment="content">
    <div class="container">
        <div class="row g-2">
            <div class="col-lg-9 mb-2">
                <div class="card border-0 rounded-3 p-2 mb-2" >
                    <div>
                        <div>
                            <!-- 按钮控制区域 -->
                            <div>
                                <div class="my-2">
                                    <button class="ui primary button recOpen recOpen2" onclick="recOpen()" style="margin-right:10px">打开录音,请求权限</button>
                                    <button class="ui primary button recClose recClose223 " onclick="recClose()" style="margin-right:0;display: none">关闭录音,释放资源</button>
                                </div>

                                <button class="ui primary button recClose recStart" style=";display: none" onclick="recStart()">录制</button>
                                <button class="ui red button recClose recStop recStopBtn" onclick="recStop()" style="margin-right:80px;display: none">录制完成</button>

                                <span style="display: inline-block;" class="recClose recStop recPauseAndRecResume">
                                    <button class="ui primary button" style=";display: none" onclick="recPause()">暂停</button>
                                    <button class="ui primary button" style=";display: none" onclick="recResume()">继续</button>
                                </span>
                                <span style="display: inline-block;" class="recClose recStop">
                                    <button class="ui primary button recPlay" style=";display: none" onclick="recPlay()">播放</button>
                                    <button class="ui primary button recUpload" style=";display: none" onclick="recUpload()">上传</button>
                                </span>
                            </div>

                            <div class="all-wave">
                                <!-- 波形绘制区域 -->
                                <div class="lead border-top mt-2">波形绘制区域</div>
                                <div class="my-2">
                                    <div style="border:0px solid #ccc;display:inline-block"><div style="height:100px;width:300px;" class="recwave"></div></div>
                                    <div style="height:40px;width:300px;position:relative;">
                                        <div class="recpowerx" style="height:40px;background:#0B1;position:absolute;"></div>
                                        <div class="recpowert" style="padding-left:50px; line-height:40px; position: relative;"></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="process-div mb-2" style="display: none">
                            <div class="text-black-50 progress-div-tips small">上传中,请稍等</div>
                            <div class="progress">
                                <div class="progress-bar progress-bar-striped progress-bar-animated bg-success" role="progressbar"><span class="progress-text"></span></div>
                            </div>
                        </div>

                        <form class="record-form" style=";display: none">
                            <div class="ui primary button" onclick="recPlay()">播放</div>
                            <div class="ui form mb-3">
                                <label for="radio-intro" class="text-black-50">音频内容简介</label>
                                <textarea type="text" rows="2" class="field" id="radio-intro" placeholder="简介"></textarea>
                            </div>
                            <button type="submit" class="ui primary button public-radio">确定</button>
                        </form>
                    </div>
                </div>
            </div>
            <div class="col-lg-3">
                <div class="card border-0 rounded-3 p-2">
                    <div class="lead ">录制声音</div>
                </div>

                <!-- 日志输出区域 -->
                <div class="mt-2 card border-0 rounded-3 p-2 reclog" style="display: none;"></div>
                <div class="mt-2 card border-0 rounded-3 p-2 small text-black-50">
                    * 温馨提示: 使用Chrome录制体验更佳
                </div>
            </div>
        </div>
    </div>
</div>
</html>
